package com.maychat.service;

import com.maychat.enums.MessageType;
import com.maychat.exception.BusinessException;
import com.maychat.pojo.GroupInfo;
import com.maychat.pojo.RowsWithTotal;
import com.maychat.pojo.extended.GroupInfoWithOwnerName;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface GroupInfoService {
    void saveGroup(GroupInfo groupInfo, MultipartFile avatarSmall, MultipartFile avatarFull) throws BusinessException, IOException;

    List<GroupInfo> getMyGroups(String userId);

    GroupInfo selectGroupInfoById(String groupId);

    RowsWithTotal<GroupInfoWithOwnerName> selectWithOwnerNameCondByPage(GroupInfo groupInfo, Integer page, Integer pageSize);

    void dissolveGroup(String groupId, String groupOwnerId) throws BusinessException;

    void changeGroupMember(String userId, String groupId, List<String> ids, Integer action) throws BusinessException;

    void leaveGroup(String userId, String groupId, MessageType type) throws BusinessException;

    Integer selectGroupMemberCount(String groupId);
}
